{block name="circle_layout"}
	{include file="common:common_layout"}
{/block}
{extend name="common/layout" /}
{block name="style"}
<link href="__CIRCLE_TEMPLATES_URL__/css/ubb.css" rel="stylesheet" type="text/css">
{/block}
{block name="content"}
<div class="group warp-all">
    {include file="circle:group:group_top" /}
    
    <div class="theme-editor">
        <form method="post" id="reply_form1" action="{:url('circle/theme/edit_reply')}?c_id={$c_id}&t_id={$reply_info['theme_id']}&r_id={$reply_info['reply_id']}">
            <input type="hidden" name="form_submit" value="ok" />
            <div class="quick-thread">
                <div class="quick-thread-box">
                    <div class="title">
                        <label><span class="t">RE:
                                <?php if(!empty($answer)){echo '回复&nbsp;'.$answer['reply_id'].'&nbsp;楼&nbsp;'.$answer['member_name'].'&nbsp;'.的回复;}else{echo $theme_info['theme_name'];}?>
              </span></label>
                    </div>
                    <?php echo showMiniEditor('replycontent', $reply_info['reply_content'], 'all', $affix_list, 'goods', $goods_list);?>
                    <div class="bottom"> <a class="submit-btn" nctype="reply_submit" href="Javascript: void(0)"><?php echo 编辑回复;?></a> <a class="cancel-btn" href="Javascript:history.go(-1);" nctype="theme_cancle"><?php echo 取消;?></a>
                        <div id="warning"></div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript" src="__SITE_RESOURCE__/js/fileupload/jquery.iframe-transport.js" charset="utf-8"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/fileupload/jquery.ui.widget.js" charset="utf-8"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/fileupload/jquery.fileupload.js" charset="utf-8"></script>
<script type="text/javascript" src="__CIRCLE_RESOURCE__/js/miniditor/jquery.insertsome.min.js"></script>
<script type="text/javascript" src="__CIRCLE_RESOURCE__/js/miniditor/ubb.insert.js" charset="utf-8"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.validation.min.js"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.mousewheel.js"></script>
<script type="text/javascript">
    var c_id = <?php echo $c_id;?>;
    var t_id = <?php echo $t_id;?>;
    $(function(){
        $('.theme-editor').ncUBB({
            c_id : <?php echo $c_id;?>,
            t_id : <?php echo $t_id;?>,
            UBBContent : $('#replycontent'),
            UBBSubmit : $('a[nctype="reply_submit"]'),
            UBBform : $('#reply_form1'),
            UBBfileuploadurl : "<?php echo url('/circle/theme/image_upload/');?>?c_id="+c_id+"&type=reply",
            UBBcontentleast : <?php echo intval(sysconf('circle_contentleast'));?>
	});
	//自定义滚定条
	$('#scrollbar').perfectScrollbar();
	// 表单验证
    $('#reply_form').validate({
        errorLabelContainer: $('#warning'),
        invalidHandler: function(form, validator) {
               $('#warning').show();
        },
    	submitHandler:function(form){
    		ajaxpost('reply_form', "<?php echo url('circle/theme/save_reply');?>?c_id="+c_id+"&t_id="+t_id, '', 'onerror');
    	},
        rules : {
        	replycontent : {
                required : true
                <?php if(intval(sysconf('circle_contentleast')) > 0){?>
                ,minlength : <?php echo intval(sysconf('circle_contentleast'));?>
                <?php }?>
            }
        },
        messages : {
        	replycontent  : {
                required : '请填写内容'
        <?php if(intval(sysconf('circle_contentleast')) > 0){?>
                ,minlength : "<?php printf('内容不能少于%d个字符', intval(sysconf('circle_contentleast')));?>"
        <?php }?>
        }
        }
        });
        });
</script>
{/block}